Json格式化 void ShowTree(TreeNode node,Dictionary<string, object>[] dic)
{
for (int i = 0; i < dic.Length; i )
{
TreeNode treeNode2 = new TreeNode($"[{i}]");
treeNode2.ImageIndex = 1;
node.Nodes.Add(treeNode2);
foreach (var item in dic[i])
{
if (CheckValues(item.Value).Length>0)
{
Dictionary<string, object>[] dic2 = CheckValues(item.Value.ToString());
this.ShowTree(treeNode2, item.Key, dic2);
}
else
{
TreeNode treeNode3 = new TreeNode($"{item.Key}:{item.Value}");
treeNode3.ImageIndex = 2;
treeNode2.Nodes.Add(treeNode3);
}
}
}
}
评论